package com.kd.kdaicodemother.service;

import com.kd.kdaicodemother.model.dto.app.AppAddRequest;
import com.kd.kdaicodemother.model.dto.app.AppQueryRequest;
import com.kd.kdaicodemother.model.entity.User;
import com.kd.kdaicodemother.model.vo.AppVO;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.core.service.IService;
import com.kd.kdaicodemother.model.entity.App;
import reactor.core.publisher.Flux;

import java.util.List;

/**
 * 应用 服务层。
 *
 * @author KD
 */
public interface AppService extends IService<App> {


    AppVO getAppVO(App app);

    Long createApp(AppAddRequest appAddRequest, User loginUser);

    QueryWrapper getQueryWrapper(AppQueryRequest appQueryRequest);

    List<AppVO> getAppVOList(List<App> appList);

    /**
     * 应用部署
     */
    String deployApp(Long appId,User loginUser);

    /**
     * 异步生成应用截图并更新封面
     * @param appId
     * @param appDeployUrl
     */
    void generateAppScreenshotAsync(Long appId, String appDeployUrl);

    /**
     * 通过对话生成代码
     * @param message
     * @param loginUser
     * @param appId
     * @return
     */
    Flux<String> chatToGenCode(String message, User loginUser, Long appId);
}
